package org.evej.apiparser.model.character;

import java.io.Serializable;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

public class ApiCoorporationRoles implements Serializable {

    private static final long serialVersionUID = 6574738272L;

    private final Set<ApiCoorporationRole> roles;
    private final Set<ApiCoorporationRole> rolesAtHQ;
    private final Set<ApiCoorporationRole> rolesAtBase;
    private final Set<ApiCoorporationRole> rolesAtOther;

    private ApiCoorporationRoles(Builder builder) { 
        roles = Collections.unmodifiableSet(builder.roles);
        rolesAtHQ = Collections.unmodifiableSet(builder.rolesAtHQ);
        rolesAtBase = Collections.unmodifiableSet(builder.rolesAtBase);
        rolesAtOther = Collections.unmodifiableSet(builder.rolesAtOther);
    }
    
    public Set<ApiCoorporationRole> getRoles() {
        return roles;
    }

    public Set<ApiCoorporationRole> getRolesAtHQ() {
        return rolesAtHQ;
    }

    public Set<ApiCoorporationRole> getRolesAtBase() {
        return rolesAtBase;
    }

    public Set<ApiCoorporationRole> getRolesAtOther() {
        return rolesAtOther;
    }
    
    public static class Builder {
        private Set<ApiCoorporationRole> roles = new HashSet<>();
        private Set<ApiCoorporationRole> rolesAtHQ = new HashSet<>();
        private Set<ApiCoorporationRole> rolesAtBase = new HashSet<>();
        private Set<ApiCoorporationRole> rolesAtOther = new HashSet<ApiCoorporationRole>();

        public Builder() {
        }

        public void addRole(ApiCoorporationRole role) {
            roles.add(role);
        }

        public void addRoleAtHQ(ApiCoorporationRole role) {
            rolesAtHQ.add(role);
        }

        public void addRoleAtBase(ApiCoorporationRole role) {
            rolesAtBase.add(role);
        }

        public void addRoleAtOther(ApiCoorporationRole role) {
            rolesAtOther.add(role);
        }

        public ApiCoorporationRoles build() {
            return new ApiCoorporationRoles(this);
        }
    }

}
